import request from '@/utils/request'
import {SERVER_URL} from '@/utils/common'
export function getUserListPage(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+"/user/getUserListPage",
    method: 'post',
    data:params
  })

}



export function disabledOrEnabled(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/user/disabledOrEnabled`,
    method: 'post',
    data: params
  })
}



export function saveOrUpdate(params) {
  return request({
    url: params.id ? SERVER_URL.SYSTEM_SERVER+`/user/update` : SERVER_URL.SYSTEM_SERVER+`/user/save`,
    method: 'post',
    data:params
  })
}


export function assignRoles(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/user/assignRoles`,
    method: 'post',
    data:params
  })
}


export function assignDataScope(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/user/assignDataScope`,
    method: 'post',
    data:params
  })
}

export function getDataScopeByUserName(userName) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/user/getDataScopeByUserName?userName=${userName}`,
    method: 'get'
  })
}
export function updatePassword(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/user/updatePassword`,
    method: 'post',
    data:params
  })
}


export function getDepartmentLeadersByDepartmentId(departmentId) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/user/getDepartmentLeadersByDepartmentId?departmentId=`+departmentId,
    method: 'get',
  })
}
